php flip array

40

array flip php -

<?php
$input = array("oranges", "apples", "pears");
$flipped = array_flip($input);

print_r($flipped);

php flip array -

<?php
$input = array("oranges", "apples", "pears");
$flipped = array_flip($input);

print_r($flipped);
?>

php array flip -

$input = array("a" => 1, "b" => 1, "c" => 2);
$flipped = array_flip($input);

print_r($flipped);

# Output
Array
(
    [1] => b
    [2] => c
)

Comments

Submit
0 Comments